package image;
import junit.framework.TestCase;
import image.*;

public class ImageCacheTest extends TestCase {
	ImageCache a;
	ImageCache b;
	
	/**
     * Sets up the test fixture. 
     * (Called before every test case method.) 
     */ 
    protected void setUp() { 
        a = new ImageCache();
        b = new ImageCache();
    } 


    /**
     * Tears down the test fixture. 
     * (Called after every test case method.) 
     */ 
    protected void tearDown() { 
         a = null;
         b = null; 
    } 
    
    /** Ensure that multiple ImageCaches are always equal. */
    public void testImageCache(){
    	assertEquals(a.getCache(), a.getCache());
    	assertEquals(b.getCache(), b.getCache());
    	assertEquals(a.getCache(), b.getCache());
    	a.getSprite("resource/graphics/lemming/walker/walker1.gif");
    	assertEquals(a.getCache(), b.getCache());
    	b.getSprite("resource/graphics/lemming/walker/walker4.gif");
    	assertEquals(a.getCache(), b.getCache());
    	a.clear();
    	assertEquals(a.getCache(), b.getCache());
    }

}
